6bc74a8b9d336190c516c53793545102c752a318,api/src/main/java/org/openmrs/module/fhir/api/impl/PatientServiceImpl.java,PatientServiceImpl,searchPatientsByGivenName,#String#,146
Before Change
List<Patient> fhirPatientList = new ArrayList<Patient>();
//Go through the patients given by the openmrs core api and find them patient who has the givenName matching
for (org.openmrs.Patient patient : patients) {
if (givenName.equalsIgnoreCase(patient.getGivenName())) {
fhirPatientList.add(FHIRPatientUtil.generatePatient(patient));
} else {
for (PersonName personName : patient.getNames()) {
After Change
/**
* @see org.openmrs.module.fhir.api.PatientService#searchPatientsByGivenName(String)
*/
public Bundle searchPatientsByGivenName(String givenName) {
List<org.openmrs.Patient> patients = searchPatientByQuery(givenName);
List<Patient> fhirPatientList = new ArrayList<Patient>();
//Go through the patients given by the openmrs core api and find them patient who has the givenName matching
for (org.openmrs.Patient patient : patients) {
if (givenName.toLowerCase().contains(patient.getGivenName().toLowerCase())) {
fhirPatientList.add(FHIRPatientUtil.generatePatient(patient));
} else {
for (PersonName personName : patient.getNames()) {